/**
 * 
 */
package org.gas.barapraja.proc;

import org.apache.log4j.Logger;

/**
 * @author gilang
 *
 */
public class PduProccesorFactory implements ProcessorFactory {
	
	private static final Logger logger=Logger.getLogger(PduProccesorFactory.class);
	
	private static ProcessorFactory processorFactory;
	
	PduProccesorFactory() {
	
	}
	
	public static ProcessorFactory getFactory(){
		if(processorFactory==null)
			processorFactory=new PduProccesorFactory();
		return processorFactory;
	}

	/* (non-Javadoc)
	 * @see org.gas.barapraja.proc.ProcessorFactory#createPduProcessor(org.gas.barapraja.proc.GasSmscSession)
	 */
	@Override
	public PduProcessor createPduProcessor(GasSmscSession session) {
		PduProcessor processor=new IncomingPduProcessor(session);
		PduProcessorContainer.getContainerInstance().addProcessor(processor);
		logger.info("new pdu processor create");
		return processor;
	}

}
